from pyeasyaccept.gui.ConsolePanel import ConsolePanel
import unittest
import wx

"""
This class tests the 'ConsolePanel' panel
@author: Mikaela Maia
"""
class ConsolePanelTest(unittest.TestCase):
    
    """
    This method sets initial information
    """
    def setUp(self):
        self.app = wx.App()
        self.frame = wx.Frame(None, -1)
        self.panel = ConsolePanel(self.frame, -1)
        
        
    """
    This method tear down informations
    """
    def tearDown(self):
        self.app.Destroy()
        self.frame.Destroy()
        self.panel.Destroy()
        
    """
    This method runs the successful tests
    """
    def testConsolePanel(self):
        self.panel.setResult(" ")
        self.assertEquals( self.panel.getResult(), " ")
        
        self.panel.setResult("Result1")
        self.panel.setResult("Result2")
        self.assertEquals( self.panel.getResult(),"Result2")

    
if __name__ == '__main__':
    unittest.main() 